<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        //
        'App\Console\Commands\OrderUpdate',
        'App\Console\Commands\SignScore',
        'App\Console\Commands\TeacherSignScore',
        'App\Console\Commands\SendMessage',
        'App\Console\Commands\OrderCancel',
        'App\Console\Commands\AbsenceAdd',
    ];

    /**
     * Define the application's command schedule.
     *
     * @param \Illuminate\Console\Scheduling\Schedule $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        $schedule->command('order:update')->everyMinute()->runInBackground();
        $schedule->command('sign:score')->everyMinute()->runInBackground();
        $schedule->command('teacher_sign:score')->everyMinute()->runInBackground();
        $schedule->command('send:message')->dailyAt("12:30")->runInBackground();
        $schedule->command('order:cancel')->everyMinute()->runInBackground();
        $schedule->command('absence')->everyMinute()->runInBackground();
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__ . '/Commands');

        require base_path('routes/console.php');
    }
}
